<div class="container">
  <h1>form_open_upload()</h1>
  <p class="signature">function form_open_upload(string $location, ?array $attributes = null): string</p>
  <h2>Description</h2>
  <div class="description">
    <p>Generates the opening tag for an HTML form with file upload support.</p>
  </div>
  <h2>Parameters</h2>
  <table>
    <thead>
      <tr>
        <th>Parameter</th>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>$location</td>
        <td>string</td>
        <td>The URL to which the form will be submitted.</td>
      </tr>
      <tr>
        <td>$attributes</td>
        <td>array|null</td>
        <td>(optional) An array of HTML attributes for the form. Default is null.</td>
      </tr>
    </tbody>
  </table>
  <h2>Return Value</h2>
  <table>
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>string</td>
        <td>The HTML opening tag for the form with enctype set to "multipart/form-data."</td>
      </tr>
    </tbody>
  </table>
  <h2>Example #1</h2>
  <p>The code sample below demonstrates the basic usage of the <code>form_open_upload</code> function.</p>
  <pre>
  $location = 'upload.php';
  echo form_open_upload($location);
  // Output:
  // &lt;form action="upload.php" method="post" enctype="multipart/form-data"&gt;
  </pre>
  <h2>Example #2</h2>
  <p>The code sample below demonstrates a more complex usage of the <code>form_open_upload</code> function with additional attributes.</p>
  <pre>
  $location = 'upload.php';
  $attributes = [
      'id' => 'upload-form',
      'class' => 'form-horizontal',
      'onsubmit' => 'return validateForm()'
  ];
  echo form_open_upload($location, $attributes);
  // Output:
  // &lt;form action="upload.php" method="post" enctype="multipart/form-data" id="upload-form" class="form-horizontal" onsubmit="return validateForm()"&gt;
  </pre>
  <h2>Notes</h2>
  <ul>
    <li>This function automatically sets the <code>enctype</code> attribute to "multipart/form-data", which is required for file uploads.</li>
    <li>The function internally calls the <code>form_open()</code> function to generate the HTML.</li>
    <li>If the <code>$attributes</code> array includes an 'enctype' key, it will be overwritten with "multipart/form-data".</li>
    <li>The <code>method</code> attribute is set to "post" by default (handled by the <code>form_open()</code> function).</li>
    <li>Remember to close your form with the <code>&lt;/form&gt;</code> tag or use a corresponding <code>form_close()</code> function if available.</li>
  </ul>
</div>